<template>
    <div>
        <h1>注册</h1>
        <table>
            <tr>
                <td>账号</td>
                <td>
                    <input type="text" v-model="state.Lname">    
                </td>
            </tr>
            <tr>
                <td>密码</td>
                <td>
                    <input type="password" v-model="state.Lpwd" >
                </td>
            </tr>
            <tr>
                <td>
                    <input type="button" value="注册" @click="zhuce" >
                </td>
                <td></td>
            </tr>
        </table>

    </div>
</template>

<script setup lang="ts">
import { reactive,toRefs,onMounted} from 'vue'
import { useRoute,useRouter } from 'vue-router'
import axios from 'axios'

const route = useRoute()
const router = useRouter()

const data=reactive({
    state:{
        Lname:'',
        Lpwd:''
    }
})

const {state} = toRefs(data)

const zhuce = () => {
    axios({
        url:'https://localhost:7092/api/Login/Logins',
        method:'get',
        params:state.value
        
    }).then(res=>{
        console.log(res);
        if(res.data.data >0){
            alert('注册成功')
        }else{
            alert('注册失败')
        }
    })
    .catch((err)=>{
        console.log(err)
    })
    
}

</script>

<style scoped>

</style>